{% extends "base.html" %}
{% load static %}
{% block title %} article column {% endblock %}
{% block content %}
    <div>
        <p class="text-right"><button class="btn btn-primary" onclick="add_column()">add column</button></p>
        <table class="table table-hover">
        <tr>
            <th style="font-size: medium">序号</th>
            <th style="font-size: medium">栏目名称</th>
            <th style="font-size: medium">操作</th>
        </tr>
        {% for column in columns %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td><a href="{% url 'article:show_column_article' %}?c_id={{ column.id }}&c_name={{ column.c_name }}">{{ column.c_name }}</a></td>
            <td>
                <a name="edit" href="javascript:" onclick="edit_column(this, {{ column.id }})">
                <span class="glyphicon glyphicon-pencil"></span>
                </a>
                <a name="delete" href="javascript:" onclick="del_column(this, {{ column.id }})">
                    <span class="glyphicon glyphicon-trash" style="margin-left:20px; "></span>
                </a>
            </td>
        </tr>
        {% empty %}
        <p>还没有设置栏目，太懒了。</p>
        {% endfor %}
        </table>
    </div>
{% endblock %}
{% block jsFiles %}
    <script type="text/javascript" src="{% static 'js/article/article_column_manage.js' %}"></script>
{% endblock %}